﻿<UserControl x:Class="RapidSilverDemo.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:rl="clr-namespace:Jalindi.RapidLayout;assembly=RapidLayout2009.Silverlight"
             xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    Width="700" Height="300">
    <controls:DockPanel x:Name="LayoutRoot" Background="White">
        <ScrollViewer controls:DockPanel.Dock="Bottom" Height="100"><TextBlock TextWrapping="Wrap"  
                   Text="{Binding ElementName=Panel, Path=DebugInformation}">
        </TextBlock>
            </ScrollViewer>
        <Border BorderThickness="2"  BorderBrush="Black">
        <rl:RapidPanel Name="Panel" ShouldDebug="True">
            <rl:RapidPanel.Guides>
                <rl:HorizontalGuide Name="myGuide" >
                    <rl:HorizontalGuide.Top>
                        <rl:TopConnection Constraint="SpringAndPreferred" Length="70" />
                    </rl:HorizontalGuide.Top>
                    <rl:HorizontalGuide.Bottom>
                        <rl:BottomConnection Constraint="Preferred"/>
                    </rl:HorizontalGuide.Bottom>
                </rl:HorizontalGuide>
            </rl:RapidPanel.Guides>
            <Button Name="b1" rl:RapidPanel.Left="constraint=preferred" 
                    rl:RapidPanel.Top="preferred"  Width="100" Height="20" Content="button b1"></Button>
            <Button Name="b2" rl:RapidPanel.Left="c=preferred,t=b1:right" rl:RapidPanel.Top="preferred"
                    rl:RapidPanel.Horizontal="preferred" Content="button b2"></Button>
                <Button Name="b3" rl:RapidPanel.Left="clamp,t=b2:right" Content="button b3"></Button>
                <!--<Button Name="two" Margin="0,0,0,0" Width="100" Content="button 2">
                <rl:RapidPanel.Left>
                    <rl:ExternalConnection Constraint="Preferred" ></rl:ExternalConnection>
                </rl:RapidPanel.Left>
                <rl:RapidPanel.Width>
                    <rl:InternalConnection Constraint="Fixed"/>
                </rl:RapidPanel.Width>
            </Button>
            <Button Name="three" Margin="0,0,0,0" Width="100" Height="20" Content="button 55">
                <rl:RapidPanel.Left>
                    <rl:ExternalConnection Length="10" TargetName="two" Attach="Tie"></rl:ExternalConnection>
                </rl:RapidPanel.Left>
                <rl:RapidPanel.Width>
                    <rl:InternalConnection Constraint="Preferred"/>
                </rl:RapidPanel.Width>
            </Button>

            <Button Name="cancel" Content="Cancel">
                <rl:RapidPanel.Left>
                    <rl:ExternalConnection Constraint="SpringAndPreferred"></rl:ExternalConnection>
                </rl:RapidPanel.Left>
                <rl:RapidPanel.Right>
                    <rl:ExternalConnection Constraint="Preferred"  TargetName="apply" ></rl:ExternalConnection>
                </rl:RapidPanel.Right>
                <rl:RapidPanel.Top>
                    <rl:ExternalConnection Constraint="SpringAndPreferred"></rl:ExternalConnection>
                </rl:RapidPanel.Top>
                <rl:RapidPanel.Bottom>
                    <rl:ExternalConnection Constraint="Preferred"></rl:ExternalConnection>
                </rl:RapidPanel.Bottom>
                <rl:RapidPanel.Width>
                    <rl:InternalConnection AlignerName="okApplyCancel"></rl:InternalConnection>
                </rl:RapidPanel.Width>
            </Button>
            <Button Name="apply" Content="Apply">
                <rl:RapidPanel.Left>
                    <rl:ExternalConnection Constraint="SpringAndPreferred"></rl:ExternalConnection>
                </rl:RapidPanel.Left>
                <rl:RapidPanel.Right>
                    <rl:ExternalConnection Constraint="Preferred" TargetName="ok" ></rl:ExternalConnection>
                </rl:RapidPanel.Right>
                <rl:RapidPanel.Top>
                    <rl:ExternalConnection Constraint="SpringAndPreferred"></rl:ExternalConnection>
                </rl:RapidPanel.Top>
                <rl:RapidPanel.Bottom>
                    <rl:ExternalConnection Constraint="Preferred" TargetName="myGuide"></rl:ExternalConnection>
                </rl:RapidPanel.Bottom>
                <rl:RapidPanel.Width>
                    <rl:InternalConnection AlignerName="okApplyCancel">
                        </rl:InternalConnection>
                </rl:RapidPanel.Width>
            </Button>
            <Button Name="ok" Margin="0,0,0,0" Content="OK">
                <rl:RapidPanel.Left>
                    <rl:ExternalConnection Constraint="SpringAndPreferred"></rl:ExternalConnection>
                </rl:RapidPanel.Left>
                <rl:RapidPanel.Right>
                    <rl:ExternalConnection Constraint="Preferred"></rl:ExternalConnection>
                </rl:RapidPanel.Right>
                <rl:RapidPanel.Top>
                    <rl:ExternalConnection Constraint="Preferred" TargetName="myGuide"></rl:ExternalConnection>
                </rl:RapidPanel.Top>
                <rl:RapidPanel.Bottom>
                    <rl:ExternalConnection Constraint="Preferred" Length="10"></rl:ExternalConnection>
                </rl:RapidPanel.Bottom>
                <rl:RapidPanel.Width>
                    <rl:InternalConnection AlignerName="okApplyCancel">
                    </rl:InternalConnection>
                </rl:RapidPanel.Width>
            </Button>-->
        </rl:RapidPanel>
            </Border>
    </controls:DockPanel>
</UserControl>
